summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin/src/create.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-10-13 23:54:27 +0200
committerSamy Pesse <samypesse@gmail.com>2016-10-13 23:54:27 +0200
commit5839d4d8a8360a39e1f62d3fa0a242347180ab1a (patch)
tree949c513f7797b8750d94760b30aeae49d24477e5 /packages/gitbook-plugin/src/create.js
parentd9c3cb418ac772085fe2cec2769c17ee86bd697c (diff)
downloadgitbook-5839d4d8a8360a39e1f62d3fa0a242347180ab1a.zip
gitbook-5839d4d8a8360a39e1f62d3fa0a242347180ab1a.tar.gz
gitbook-5839d4d8a8360a39e1f62d3fa0a242347180ab1a.tar.bz2
Improve "gitbook-plugin create" to prompt for title/categories
Diffstat (limited to 'packages/gitbook-plugin/src/create.js')
-rw-r--r--packages/gitbook-plugin/src/create.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/gitbook-plugin/src/create.js b/packages/gitbook-plugin/src/create.js
index fa8942f..31edb85 100644
--- a/packages/gitbook-plugin/src/create.js
+++ b/packages/gitbook-plugin/src/create.js
@@ -7,16 +7,20 @@ const TEMPLATE_DIR = path.resolve(__dirname, '../template');
/**
* Create a new plugin
* @param {String} outputDir
+ * @param {String} spec.title
* @param {String} spec.name
* @param {String} spec.desc
+ * @param {Array} spec.keywords
*/
function create(outputDir, spec) {
const pkg = {
+ 'title': `${spec.title}`,
'name': `gitbook-plugin-${spec.name}`,
'description': `${spec.desc}`,
+ 'version': '0.0.0',
'main': 'index.js',
'browser': './_assets/plugin.js',
- 'version': '0.0.0',
+ 'ebook': './_assets/plugin.js',
'dependencies': {
'gitbook-core': '^' + GITBOOK_VERSION
},
@@ -29,10 +33,13 @@ function create(outputDir, spec) {
'gitbook': '>=4.0.0-alpha.0'
},
'scripts': {
- 'build-js': 'gitbook-plugin build ./src/index.js ./_assets/plugin.js',
- 'prepublish': 'npm run build-js'
+ 'lint': 'eslint ./',
+ 'build-website': 'gitbook-plugin build ./src/index.js ./_assets/plugin.js',
+ 'prepublish': 'npm run build-website',
+ 'test': 'gitbook-plugin test && npm run lint'
},
'homepage': `${spec.github}`,
+ 'keywords': spec.categories.map(category => `gitbook:${category}`),
'repository': {
'type': 'git',
'url': `${spec.github}.git`