-
Notifications
You must be signed in to change notification settings - Fork 949
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
adds 'probot scaffold' command; closes #98 #139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 this is awesome, thanks for getting it started! We'll want to update the plugin docs before this lands, but let's talk about some of the details first.
Overall, the guessing of values is nice, but I'm not convinced it's worth all the extra dependencies. It makes me wonder if this command should be extracted to a separate package, and keep probot
as just the runtime components. What do you think?
In the end, I didn't go with
init
for the command name. To me,init
means "let's start a Probot-based project", not necessarily "let's create a new Probot plugin".
I get what you're saying, but I don't love scaffold
. I'd prefer init
or maybe even new
.
bin/probot-scaffold.js
Outdated
'use strict'; | ||
|
||
const path = require('path'); | ||
const superb = require('superb'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amusing, but I don't think it's worth the dependency.
bin/probot-scaffold.js
Outdated
default: `A ${superb()} Probot plugin`, | ||
message: 'Description of plugin:', | ||
when: !program.description | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't showing up in the prompt, and the generated description is blank.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that's because commander
has absconded with program.description
. program.name
, which I had tried to use for something else, is a function. This is all very strange. I'm not a big fan of commander; there's a bit too much magic for me.
Re superb
: Yeoman uses it, so I wanted to conform.
bin/probot-scaffold.js
Outdated
type: 'input', | ||
name: 'email', | ||
default() { | ||
return guessEmail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is returning undefined
for me:
? Plugin author's full name: Brandon Keepers
? Plugin author's email address: undefined
I have a git email configured:
$ git config user.email
bkeepers@github.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You must be running this command from a working copy. Is your email address set in that directory's
.git/config
? - What is the output of
git config --global user.email
?
Not sure if this is my fault or a git-user-email bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must be running this command from a working copy.
Ah, yep, I was.
Is your email address set in that directory's
.git/config
?
Nope
What is the output of
git config --global user.email
?
git config --global user.email
bkeepers@github.com
I'm not sure how easy this would be with But...
What I think I'd like to do is address the problem you're seeing in Please let me know if you need the executable extracted despite my weak protesting. 😉
Re extra dependencies: I apologize if I go off on a tangent here, but especially since "left-pad-gate", there's been FUD in the JS community around the "hypermodular" nature of many popular Node.js packages. My stance is: if a dependency is a clear win--as it is in this case, to improve user friendliness--then by all means, it should be included, assuming there's no other obvious deal-breaker. There are performance gains to keeping the number of bytes loaded by Are there other reasons why you'd want to reduce the raw number of production dependencies? Or just the direct dependencies of Probot? |
Nah, it's fine. Let's start with it in core and we can extract it later if it's a pain.
In general, I prefer to avoid unnecessary dependencies, in the same way I prefer to avoid unnecessary features. No code is better than no code. |
Agreed. It's more about deciding what's necessary and what's not. @bkeepers I had a couple questions about the results you were getting in this review comment. |
OK, I think the missing email issue is fixed. |
c1cb57a
to
797fc04
Compare
@boneskull thanks for your work on this, and sorry for letting it languish. After a couple months of thinking about it, I think I'd like to extract this into a Thoughts? |
This has been extracted to https://github.com/probot/create-probot-plugin @boneskull thanks so much for your work on this! |
Here's basic support for scaffolding a plugin.
In the end, I didn't go withinit
for the command name. To me,init
means "let's start a Probot-based project", not necessarily "let's create a new Probot plugin".EDIT Renamed to
probot init
Anyway, here's a screencast of what it does.
As you can see from the output, it wants this PR to fix the plugin template to land.
Please let me know if you have questions about how I'm guessing default values (see
user.js
).