From 696981522900eaafe3ba8aab7d88f31fcd30e68e Mon Sep 17 00:00:00 2001 From: cueedee Date: Wed, 11 Mar 2015 16:45:04 +0100 Subject: [PATCH] feat(app generator): externalize 'contributors' from 'package.json' to AUTHORS --- generators/app/index.js | 1 + generators/app/templates/AUTHORS | 9 +++++++++ generators/app/templates/_package.json | 1 - 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 generators/app/templates/AUTHORS diff --git a/generators/app/index.js b/generators/app/index.js index e0124bc9..63b2e1a5 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -148,6 +148,7 @@ module.exports = yeoman.generators.Base.extend( // write package.json and readme file // this.template( "_package.json", "package.json" ); + this.template( "AUTHORS", "AUTHORS" ); this.template( "README.md", "README.md" ); this.copy( "LICENSE", "LICENSE" ); diff --git a/generators/app/templates/AUTHORS b/generators/app/templates/AUTHORS new file mode 100644 index 00000000..bfadae05 --- /dev/null +++ b/generators/app/templates/AUTHORS @@ -0,0 +1,9 @@ +## https://docs.npmjs.com/files/package.json#default-values +## +## | `"contributors": [ ... ]` +## | +## | If there is an AUTHORS file in the root of your package, npm will treat +## | each line as a `Name (url)` format, where `email` and `url` are +## | optional. Lines which start with a # or are blank, will be ignored. + +<%= authorName %><% if ( authorEmail ) { %> <<%= authorEmail %>><% } %><% if ( authorUrl ) { %> (<%= authorUrl %>)<% } %> diff --git a/generators/app/templates/_package.json b/generators/app/templates/_package.json index 428d6f66..a767a452 100644 --- a/generators/app/templates/_package.json +++ b/generators/app/templates/_package.json @@ -13,7 +13,6 @@ ] }, "browserify-shim": {}, - "contributors": [], "dependencies": { "backbone": "~1.1.2", "madlib-console": "~0.1.4",