Skip to content

Commit

Permalink
Merge pull request #187 from bitsoflogic/master
Browse files Browse the repository at this point in the history
Trailing whitespace cleanup (#186)
  • Loading branch information
marshallswain authored and daffl committed Aug 25, 2018
1 parent 4c4f445 commit f2030dc
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions packages/generator-feathers/generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const makeConfig = require('./configs');
module.exports = class AppGenerator extends Generator {
constructor(args, opts) {
super(args, opts);

this.props = {
name: this.pkg.name || process.cwd().split(path.sep).pop(),
description: this.pkg.description,
Expand Down Expand Up @@ -102,7 +102,7 @@ module.exports = class AppGenerator extends Generator {
if(input.indexOf('primus') !== -1 && input.indexOf('socketio') !== -1) {
return 'You can only pick SocketIO or Primus, not both.';
}

return true;
}
}];
Expand Down Expand Up @@ -161,11 +161,11 @@ module.exports = class AppGenerator extends Generator {
this.props.providers.forEach(
provider => this.dependencies.push(`feathers-${provider}`)
);

this._packagerInstall(this.dependencies, {
save: true
});

this._packagerInstall(this.devDependencies, {
saveDev: true
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Getting up and running is as easy as 1, 2, 3.

1. Make sure you have [NodeJS](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed.
2. Install your dependencies

```
cd path/to/<%= name %>; npm install
```
3. Start your app
```
npm start
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const OAUTH2_STRATEGY_MAPPINGS = {
module.exports = class AuthGenerator extends Generator {
prompting() {
this.checkPackage();

const prompts = [{
type: 'checkbox',
name: 'strategies',
Expand Down
20 changes: 10 additions & 10 deletions packages/generator-feathers/generators/connection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,26 @@ module.exports = class ConnectionGenerator extends Generator {
}
]
};

case 'memory':
return null;

case 'mongodb':
this.dependencies.push(adapter);
return connectionString;

case 'mariadb':
case 'mysql':
case 'mssql':
// case oracle:
case 'postgres': // eslint-disable-line no-fallthrough
case 'sqlite':
this.dependencies.push(adapter);

if (sqlPackages[database]) {
this.dependencies.push(sqlPackages[database]);
}

if (adapter === 'sequelize') {
return connectionString;
}
Expand All @@ -98,7 +98,7 @@ module.exports = class ConnectionGenerator extends Generator {
throw new Error(`Invalid database '${database}'. Cannot assemble configuration.`);
}
}

_writeConfiguration() {
const { database } = this.props;
const config = Object.assign({}, this.defaultConfig);
Expand All @@ -116,13 +116,13 @@ module.exports = class ConnectionGenerator extends Generator {

prompting() {
this.checkPackage();

const databaseName = snakeCase(this.pkg.name);
const { defaultConfig } = this;

const getProps = answers => Object.assign({}, this.props, answers);
const setProps = props => Object.assign(this.props, props);

const prompts = [
{
type: 'list',
Expand All @@ -144,7 +144,7 @@ module.exports = class ConnectionGenerator extends Generator {
when(current) {
const answers = getProps(current);
const { database, adapter } = answers;

if (database) {
return false;
}
Expand Down Expand Up @@ -232,14 +232,14 @@ module.exports = class ConnectionGenerator extends Generator {
sqlite: `sqlite://${databaseName}.sqlite`,
mssql: `mssql://root:password@localhost:1433/${databaseName}`
};

return defaultConnectionStrings[database];
},
when(current) {
const answers = getProps(current);
const { database } = answers;
const connectionString = defaultConfig[database];

if (connectionString) {
setProps({ connectionString });
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function() {
const connectionString = app.get('mssql');
const connection = url.parse(connectionString);
const database = connection.path.substring(1, connection.path.length);
const { port, hostname, username, password } = connection;
const { port, hostname, username, password } = connection;
const sequelize = new Sequelize(database, username, password, {
dialect: 'mssql',
host: hostname,
Expand All @@ -28,7 +28,7 @@ module.exports = function() {

app.setup = function(...args) {
const result = oldSetup.apply(this, args);

// Set up data relationships
const models = sequelize.models;
Object.keys(models).forEach(name => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function() {

app.setup = function(...args) {
const result = oldSetup.apply(this, args);

// Set up data relationships
const models = sequelize.models;
Object.keys(models).forEach(name => {
Expand Down
2 changes: 1 addition & 1 deletion packages/generator-feathers/generators/hook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = class HookGenerator extends Generator {

prompting() {
this.checkPackage();

const services = this._listDirectories(this.libDirectory, 'services');
const prompts = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/generator-feathers/generators/middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const j = require('../../lib/transform');
module.exports = class MiddlewareGenerator extends Generator {
prompting() {
this.checkPackage();

const prompts = [
{
name: 'name',
Expand Down
2 changes: 1 addition & 1 deletion packages/generator-feathers/generators/service/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const createExpression = (object, property, args = []) =>
module.exports = class ServiceGenerator extends Generator {
prompting() {
this.checkPackage();

const { props } = this;
const prompts = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

// <%= name %>-model.js - A mongoose model
//
//
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.
module.exports = function(app) {
Expand Down

0 comments on commit f2030dc

Please sign in to comment.