From 1f44104fa95b274274df966b0112e4b69ecc9660 Mon Sep 17 00:00:00 2001 From: "Alfred J. Kwak" Date: Sat, 18 Feb 2017 00:21:43 +0200 Subject: [PATCH] Remove unnecessary files, add definitions --- generators/app/index.js | 21 ++++++++----------- .../app/templates/.meteor/.finished-upgraders | 15 ------------- generators/app/templates/.meteor/.gitignore | 1 - generators/app/templates/.meteor/.id | 7 ------- .../app/templates/server/definitions.js | 3 +++ 5 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 generators/app/templates/.meteor/.finished-upgraders delete mode 100644 generators/app/templates/.meteor/.gitignore delete mode 100644 generators/app/templates/.meteor/.id create mode 100644 generators/app/templates/server/definitions.js diff --git a/generators/app/index.js b/generators/app/index.js index 77cdf43..9f7d8fc 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -77,18 +77,6 @@ module.exports = Generator.extend({ generator.destinationPath('.gitignore') ); fs.mkdirSync('.meteor'); - generator.fs.copy( - generator.templatePath('.meteor/.finished-upgraders'), - generator.destinationPath('.meteor/.finished-upgraders') - ); - generator.fs.copy( - generator.templatePath('.meteor/.gitignore'), - generator.destinationPath('.meteor/.gitignore') - ); - generator.fs.copy( - generator.templatePath('.meteor/.id'), - generator.destinationPath('.meteor/.id') - ); generator.fs.copy( generator.templatePath('.meteor/packages'), generator.destinationPath('.meteor/packages') @@ -124,6 +112,15 @@ module.exports = Generator.extend({ api: generator.api } ); + if (generator.api.definitions) { + generator.fs.copyTpl( + generator.templatePath('server/definitions.js'), + generator.destinationPath('server/definitions.js'), + { + api: generator.api + } + ); + } generator.fs.copy( generator.templatePath('server/users.js'), generator.destinationPath('server/users.js') diff --git a/generators/app/templates/.meteor/.finished-upgraders b/generators/app/templates/.meteor/.finished-upgraders deleted file mode 100644 index aa60704..0000000 --- a/generators/app/templates/.meteor/.finished-upgraders +++ /dev/null @@ -1,15 +0,0 @@ -# This file contains information which helps Meteor properly upgrade your -# app when you run 'meteor update'. You should check it into version control -# with your project. - -notices-for-0.9.0 -notices-for-0.9.1 -0.9.4-platform-file -notices-for-facebook-graph-api-2 -1.2.0-standard-minifiers-package -1.2.0-meteor-platform-split -1.2.0-cordova-changes -1.2.0-breaking-changes -1.3.0-split-minifiers-package -1.4.0-remove-old-dev-bundle-link -1.4.1-add-shell-server-package diff --git a/generators/app/templates/.meteor/.gitignore b/generators/app/templates/.meteor/.gitignore deleted file mode 100644 index 4083037..0000000 --- a/generators/app/templates/.meteor/.gitignore +++ /dev/null @@ -1 +0,0 @@ -local diff --git a/generators/app/templates/.meteor/.id b/generators/app/templates/.meteor/.id deleted file mode 100644 index ef09a0c..0000000 --- a/generators/app/templates/.meteor/.id +++ /dev/null @@ -1,7 +0,0 @@ -# This file contains a token that is unique to your project. -# Check it into your repository along with the rest of this directory. -# It can be used for purposes such as: -# - ensuring you don't accidentally deploy one app on top of another -# - providing package authors with aggregated statistics - -118uo1u8wjvlhfrieo5 diff --git a/generators/app/templates/server/definitions.js b/generators/app/templates/server/definitions.js new file mode 100644 index 0000000..42d4789 --- /dev/null +++ b/generators/app/templates/server/definitions.js @@ -0,0 +1,3 @@ +import Api from './api'; <% if(api.definitions) { %> +Api.swagger.definitions = <%-JSON.stringify(api.definitions, null, 2)%> +<% } %>