-
Notifications
You must be signed in to change notification settings - Fork 4
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.
Generally looks good, with just a few things I'd like to see changed.
name: prompt('name', basename || package.name), | ||
version: '0.0.1', | ||
description: prompt(s => s), | ||
main: prompt('entry point', 'index.js', ep => fs.writeFileSync(ep, '')), |
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.
Can we write the index.js file with a simple template like 'module.exports = exports = {};]\n` Just so it's non-empty and ends in a linefeed?
description: prompt(s => s), | ||
main: prompt('entry point', 'index.js', ep => fs.writeFileSync(ep, '')), | ||
author: 'Red Hat, Inc.', | ||
license: 'Apache-2.0', |
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.
Can we write a LICENSE
file that contains the following text?
Copyright 2016 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'LICENSE', | ||
'index.js' | ||
], | ||
bugs: {url: 'https://github.com/USER/' + basename + '/issues'}, |
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.
Why not compute the base Github URL at the top of the script and use process.env.USER
, then use that base here and in the couple of other places where the URL shows up (lines 24 and 33).
const user = process.env.USER || 'USER';
const repoUrl = `https://github.com/${user}/${basename}`;
Then,
bugs: {url: `${repoUrl}/issues`},
], | ||
bugs: {url: 'https://github.com/USER/' + basename + '/issues'}, | ||
homepage: 'https://github.com/USER/' + basename, | ||
keywords: prompt(s => s.split(/\s+/)), |
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.
Is it possible to get some text here for the user such as "enter keywords separated by a space"?
'tap-spec': '*', | ||
tape: '*' | ||
}, | ||
cleanup: function (cb) { |
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.
What does the cleanup function do? Is it possible to display the resulting package.json and ask "is this OK?" like the default does?
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.
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.
Huh - don't know how I missed that!
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.
np, all the others are done : ]
@@ -1,4 +1,28 @@ | |||
const fs = require('fs'); | |||
const execSync = require('child_process').execSync; | |||
|
|||
const gitUser = execSync('git config user.name').toString().replace('\n',''); |
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.
I like this.
my machine username is different from github username so this solves the problem fine.
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.
Excellent
LGTM, thanks! |
No description provided.